package fileController

import (
	"CMETO/models"
	"net/http"

	"github.com/gin-gonic/gin"
)

type Result struct{}

func (r Result) DataNo(ctx *gin.Context) {
	ctx.JSON(http.StatusOK, models.ErrorResult{
		Msg:    "数据异常",
		Code:   "400",
		Result: nil,
	})
}

func (r Result) Success(ctx *gin.Context, msg string) {
	ctx.JSON(http.StatusOK, &models.AddResult{
		Msg:    msg,
		Code:   "200",
		Result: 1,
	})
}

func (r Result) Fail(ctx *gin.Context, msg string) {
	ctx.JSON(http.StatusOK, &models.AddResult{
		Msg:    msg,
		Code:   "200",
		Result: 0,
	})
}
